﻿@using MakeWeekConcerts.Models
@using Microsoft.AspNet.Mvc.Facebook.Models
@using Microsoft.AspNet.Mvc.Facebook
@model ArtistDetail
@{
    ViewBag.Title = "Details For " + Model.Name;
}

<article class="intro">
    <h3>Details For @Model.Name</h3>
</article>

<article id="content">
    <table class="table-striped table-bordered">
        <tr>
            @{ var colspan = 3; }
            @if (Model.Images != null && Model.Images.Any())
            {
                colspan = 2;
                <td><img src="@Model.Images.Last().Uri" /></td>
            }
            @if (Model.Bio != null && !string.IsNullOrEmpty(Model.Bio.Summary))
            {
                <td colspan="@colspan">@Model.Bio.Summary</td>
            }
            else
            {
                <td colspan="@colspan">No artist bio.</td>
            }
        </tr>
        <tr>
            @if (Model.Tags != null && Model.Tags.Tags != null && Model.Tags.Tags.Any())
            {
                <td colspan="3">
                    <ul>
                        @foreach (var tag in Model.Tags.Tags)
                        {
                            <li><a target="_blank" href="@tag.Url">@tag.Name</a></li>
                        }
                    </ul>
                </td>
            }
            else
            {
                <td colspan="3">No tags.</td>
            }
        </tr>
    </table>
    <div>
        <h4>Videos</h4>
        <table class="table-striped table-bordered">
            @foreach (var video in Model.Videos)
            {
                <tr>
                    <td><a target="_blank" href="http://www.youtube.com/watch?v=@video.Id">@Html.Raw(video.Thumbnails[0].GetHtml())</a></td>
                    <td>@video.Title</td>
                    <td>@video.Description</td>
                </tr>
            }
        </table>
    </div>
</article>